﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace for7raid.vkConnector
{
    public static class User
    {
        public const string UserGetFriend = "friends.get";
        public const string UserGetGroups = "getGroupsFull";
        public const string UserWhiAmI = "getUserInfo";
        public const string UserWhiAmIEx = "getUserInfoEx";
        public const string UserGetProfiles = "getProfiles";

        public static Request GetMyFriends()
        {
            return new Request(UserGetFriend)
                .AddParam("fields", "uid, first_name, last_name, nickname, sex, bdate, city, country, timezone, photo, photo_medium, photo_big, online, lists, domain");
        }

        public static Request GetProfile(int UserId)
        {
            return new Request(UserGetProfiles)
                .AddParam("uids", UserId)
                .AddParam("fields", "uid, first_name, last_name, nickname, sex, bdate, city, country, timezone, photo, photo_medium, photo_big, online, lists, domain,education");
        }

        public static Request GetProfiles(params string[] UserId)
        {
            return new Request(UserGetProfiles)
                .AddParam("uids", UserId.Take(1000).Aggregate((i, l) => i + "," + l))
                .AddParam("fields", "uid, first_name, last_name, nickname, sex, bdate, city, country, timezone, photo, photo_medium, photo_big, online, lists, domain,education");
        }

        public static Request GetProfiles(string UserId)
        {
            return new Request(UserGetProfiles)
                .AddParam("uids", UserId)
                .AddParam("fields", "uid, first_name, last_name, nickname, sex, bdate, city, country, timezone, photo, photo_medium, photo_big, online, lists, domain,education");
        }

        public static Request GetMyGroups()
        {
            return new Request(UserGetGroups);
        }

        public static Request WhoAmI()
        {
            return new Request(UserWhiAmI);
        }
        public static Request WhoAmIEx()
        {
            return new Request(UserWhiAmIEx);
        }
    }
}
